﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Colorful.Control;
using System.Windows.Media;

namespace Colorful.Test.Unit
{ 
    [TestClass]
    public class PaletteTest
    {       
        [TestMethod]
        public void SetNoColorsTest()
        {
            Palette target = new Palette();
            List<Color> colors = new List<Color>();
            target.ColorList = colors;
            Assert.AreEqual<Color>(Colors.White, target.Color1);
            Assert.AreEqual<Color>(Colors.White, target.Color2);
            Assert.AreEqual<Color>(Colors.White, target.Color3);
            Assert.AreEqual<Color>(Colors.White, target.Color4);
            Assert.AreEqual<Color>(Colors.White, target.Color5);
        }

        [TestMethod]
        public void SetOneColorTest()
        {
            Palette target = new Palette();
            List<Color> colors = new List<Color>
            {
                Colors.Red
            };
            target.ColorList = colors;
            Assert.AreEqual<Color>(Colors.Red, target.Color1);
            Assert.AreEqual<Color>(Colors.White, target.Color2);
            Assert.AreEqual<Color>(Colors.White, target.Color3);
            Assert.AreEqual<Color>(Colors.White, target.Color4);
            Assert.AreEqual<Color>(Colors.White, target.Color5);
        }

        [TestMethod]
        public void SetTwoColorTest()
        {
            Palette target = new Palette();
            List<Color> colors = new List<Color>
            {
                Colors.Red,
                Colors.Red
            };
            target.ColorList = colors;
            Assert.AreEqual<Color>(Colors.Red, target.Color1);
            Assert.AreEqual<Color>(Colors.Red, target.Color2);
            Assert.AreEqual<Color>(Colors.White, target.Color3);
            Assert.AreEqual<Color>(Colors.White, target.Color4);
            Assert.AreEqual<Color>(Colors.White, target.Color5);
        }

        [TestMethod]
        public void SetThreeColorTest()
        {
            Palette target = new Palette();
            List<Color> colors = new List<Color>
            {
                Colors.Red,
                Colors.Red,
                Colors.Red
            };
            target.ColorList = colors;
            Assert.AreEqual<Color>(Colors.Red, target.Color1);
            Assert.AreEqual<Color>(Colors.Red, target.Color2);
            Assert.AreEqual<Color>(Colors.Red, target.Color3);
            Assert.AreEqual<Color>(Colors.White, target.Color4);
            Assert.AreEqual<Color>(Colors.White, target.Color5);
        }

        [TestMethod]
        public void SetFourColorTest()
        {
            Palette target = new Palette();
            List<Color> colors = new List<Color>
            {
                Colors.Red,
                Colors.Red,
                Colors.Red,
                Colors.Red
            };
            target.ColorList = colors;
            Assert.AreEqual<Color>(Colors.Red, target.Color1);
            Assert.AreEqual<Color>(Colors.Red, target.Color2);
            Assert.AreEqual<Color>(Colors.Red, target.Color3);
            Assert.AreEqual<Color>(Colors.Red, target.Color4);
            Assert.AreEqual<Color>(Colors.White, target.Color5);
        }

        [TestMethod]
        public void SetFiveColorTest()
        {
            Palette target = new Palette();
            List<Color> colors = new List<Color>
            {
                Colors.Red,
                Colors.Red,
                Colors.Red,
                Colors.Red,
                Colors.Red
            };
            target.ColorList = colors;
            Assert.AreEqual<Color>(Colors.Red, target.Color1);
            Assert.AreEqual<Color>(Colors.Red, target.Color2);
            Assert.AreEqual<Color>(Colors.Red, target.Color3);
            Assert.AreEqual<Color>(Colors.Red, target.Color4);
            Assert.AreEqual<Color>(Colors.Red, target.Color5);
        }
    }
}